	$('#reportParamForm').submit( function() {
		var reportName= $('input:radio[name=reportName]:checked').val();
		var rptClass = $('input:radio[name=reportName]:checked').attr('class');
		switch (rptClass){
			case 'selectRegions':
				var sData = $('input', rep_regionListTable.fnGetNodes()).serialize();
			break;
			case 'selectFamilies':
				var sData = $('input', rep_familyListTable.fnGetNodes()).serialize();
			break;
			case 'selectTypes':
				var sData = $('input', rep_typeListTable.fnGetNodes()).serialize();
			break;
			case 'selectInstitutions':
				var sData = $('input', rep_instututionListTable.fnGetNodes()).serialize();
			break;
			default:
				var sData="";
		}
		
		if(sData==""){
			alert('You must select at least one item from provided list / Trebate odabrati najmanje jedan entitet iz ponudene liste');
			return false;
		}
	
		//alert(reportName);
		sData+='&reportName='+ reportName;
		//alert( "The following data would have been submitted to the server: \n\n"+sData );
	    window.open("/IPOMeetingManager-web/protected/reports_menu.do"+"?"+sData);
		return false;
	} );
	
	
		rep_instututionListTable = $('#rep_instututionListTable').dataTable({
		<%if(!request.getSession().getAttribute("org.apache.struts.action.LOCALE").toString().equals("en")){%>
 				"oLanguage": {
			"sUrl": path2SrLocaleTables
			
		}, 
		<%}%>
	 'bJQueryUI': true,
	  "bAutoWidth": false,
	  'sPaginationType': 'full_numbers',
	  "aoColumnDefs": [{ "bSortable": false,  "aTargets": [ "do-not-sort" ] }],
	  "aoColumns": [
			{ "sSortDataType": "dom-checkbox", "sWidth": "10%" },
			{ "sWidth": "90%" }
		]

	});
		
		rep_regionListTable = $('#rep_regionListTable').dataTable({
		<%if(!request.getSession().getAttribute("org.apache.struts.action.LOCALE").toString().equals("en")){%>
 				"oLanguage": {
			"sUrl": path2SrLocaleTables
			
		}, 
		<%}%>
	 'bJQueryUI': true,
	  'sPaginationType': 'full_numbers',
	  "aoColumnDefs": [{ "bSortable": false,  "aTargets": [ "do-not-sort" ] }],
	  "bAutoWidth": false,
	  "aoColumns": [ 
			{ "sWidth": "10%" },
			{ "sWidth": "90%" }
		]
	});

	rep_familyListTable = $('#rep_familyListTable').dataTable({
		<%if(!request.getSession().getAttribute("org.apache.struts.action.LOCALE").toString().equals("en")){%>
 				"oLanguage": {
			"sUrl": path2SrLocaleTables
			
		}, 
		<%}%>
	 'bJQueryUI': true,
	   "bAutoWidth": false,
	  'sPaginationType': 'full_numbers',
	  "aoColumnDefs": [{ "bSortable": false,  "aTargets": [ "do-not-sort" ] }],
	   "aoColumns": [ 
			{ "sWidth": "10%" },
			{ "sWidth": "90%" }
		]
	});


	

	 rep_typeListTable = $('#rep_typeListTable').dataTable({
		<%if(!request.getSession().getAttribute("org.apache.struts.action.LOCALE").toString().equals("en")){%>
 				"oLanguage": {
			"sUrl": path2SrLocaleTables
			
		}, 
		<%}%>
	 'bJQueryUI': true,
	  'sPaginationType': 'full_numbers',
	    "bAutoWidth": false,
		 "aoColumns": [
			{ "sSortDataType": "dom-checkbox", "sWidth": "10%" },
			{ "sWidth": "90%" }
		],
	  "aoColumnDefs": [{ "bSortable": false,  "aTargets": [ "do-not-sort" ] }]
	});
	
$("#reportsTab input[type='radio']").click(function(){
    $('div[id*="select"]').hide();
	var myClass = $(this).attr("class");
    //alert(myClass);
	uncheckAllTables();
	$('#'+myClass).show();

});

 $('#checkAllRegions').click( function() {
	$('input', rep_regionListTable.fnGetNodes()).attr('checked',this.checked);
} );

 $('#checkAllTypes').click( function() {
	$('input', rep_typeListTable.fnGetNodes()).attr('checked',this.checked);
} );
 $('#checkAllFamilies').click( function() {
	$('input', rep_familyListTable.fnGetNodes()).attr('checked',this.checked);
} );

 $('#checkAllInstitutions').click( function() {
	$('input', rep_instututionListTable.fnGetNodes()).attr('checked',this.checked);
} );
	

	
	var tabId = $.url.param("tabId");
		if(tabId == null)
			tabId = 0;
		//$( "#reportsTab" ).tabs( "option", "selected", tabId );
	
	$("#reportsTab").tabs({ selected: tabId });
	